package us.lithub.ui;

import us.lithub.R;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.fedorvlasov.lazylist.ImageLoader;

/**
 * The Class RowFriend is a view to display a friend in a list view
 */
public class RowFriend extends RelativeLayout {
	
	private Context mContext;
	private String emailAddress;
	
	/**
	 * Instantiates a new row friend.
	 *
	 * @param context the context
	 * @param attrs the attrs
	 */
	public RowFriend(Context context, AttributeSet attrs) {
		super(context, attrs);
		this.mContext = context;
	}

	/**
	 * Sets the image.
	 */
	public void setImage() {
		ImageView iv = (ImageView) findViewById(R.id.imgIcon);
		new ImageLoader(mContext).DisplayImage("http://dl.dropbox.com/u/9649335/868/default_user_thumb.png", iv);
	}
	
	/**
	 * Sets the name.
	 *
	 * @param name the new name
	 */
	public void setName(String name) {
		TextView tv = (TextView) findViewById(R.id.lblName);
		tv.setText(name);
	}
	
	/**
	 * Sets the email address.
	 *
	 * @param emailAddress the new email address
	 */
	public void setEmailAddress(String emailAddress) {
		this.emailAddress = emailAddress;
	}
	
	/**
	 * Gets the email address.
	 *
	 * @return the email address
	 */
	public String getEmailAddress() {
		return emailAddress;
	}
}